<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style type="text/css">
        /*方法一*/
        body{
            margin: 0;
            padding: 0;
        }
        .header{
            position: absolute;
            top: 0;
            height: 100px;
            width: 100%;
            background-color: teal;
        }
        .container{
            position: absolute;
            top: 100px;
            bottom: 100px;
            width: 100%;
            background-color: tomato;
        }
        .footer{
            position: absolute;
            bottom:0;
            width: 100%;
            height: 100px;
            background-color: violet;
        }
        /*方法二
        html,body{
            height: 100%;
        }
        body{
            margin: 0;
            padding: 0;
            display: flex;
            flex-direction: column;
        }
        .header{
            height: 100px;
            background-color: sienna;
        }
        .container{
            flex:1;
            background-color: slateblue;
        }
        .footer{
            height: 100px;
            background-color: teal;
        }*/
    </style>
</head>
<body>
    <div class="header"></div>
    <div class="container"></div>
    <div class="footer"></div>
</body>
</html>